package dialogos;

import java.awt.event.MouseEvent;
import java.util.List;

import javax.swing.JFrame;
import javax.swing.JOptionPane;

import org.hibernate.HibernateException;
import org.hibernate.exception.ConstraintViolationException;

import peluqueria.Peluqueria;

import accesoADatos.AccesoADatos;

import datos.Profesional;
import datos.Servicio;
import dialogos.BorrarDialog;

public class BorrarServicioDialog extends BorrarDialog {

	public BorrarServicioDialog(JFrame frame, List lista, String titulo) {
		super(frame, lista, titulo);
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	protected void jButton1MouseClicked(MouseEvent evt) {
		Servicio s =(Servicio) this.hash.get(this.jComboBox1.getSelectedItem().toString());
		AccesoADatos.getInstance().BorrarServicio(s);
		JOptionPane.showMessageDialog(this, "El servicio ha sido borrado");
		Peluqueria.getInstance().getpanelServicios().ActualizarServicios();
		this.dispose();
		//Peluqueria.getInstance().getpanelServicios().ActualizarServicios();
	}
	/**
	* This method should return an instance of this class which does 
	* NOT initialize it's GUI elements. This method is ONLY required by
	* Jigloo if the superclass of this class is abstract or non-public. It 
	* is not needed in any other situation.
	 */
	
	/**
	 * This constructor is used by the getGUIBuilderInstance method to
	 * provide an instance of this class which has not had it's GUI elements
	 * initialized (ie, initGUI is not called in this constructor).
	 */

}
